package com.ice.two;

import com.ice.utils.RabbitmqUtil;
import com.rabbitmq.client.Channel;

/**
 * 生产者发送大量消息
 *
 * @author : Ice-winters
 * @since : 2021-06-22 08:37
 */
public class Task01 {

    // 队列名称
    public static final String QUEUE_NAME = "zhc-queue";

    public static void main(String[] args) throws Exception {

        Channel channel = RabbitmqUtil.getChannel();

        channel.queueDeclare(QUEUE_NAME,false,false,false,null);

        for (int i = 0; i < 100; i++) {
            channel.basicPublish("",QUEUE_NAME, null,(i+"hello work").getBytes());
        }

    }


}
